<div class="grid_12">
    <a href="<?php echo site_url('admin/post/add') ?>" class="checker" style="padding:3px 6px;margin-bottom: 7px">Thêm tin mới</a>
    <div class="searchWrap" style="margin-bottom: 5px;float:right">
        <input type="text" id="keyword" name="keyword" class="keyword" val="<?php echo $keyword ?>" placeholder="Nhập từ khóa tìm kiếm"/>
        <input type="button" id="search" value="Tìm kiếm" rel="<?php echo site_url('admin/post/index') ?>"/>
    </div>
    <div id="demo" class="clearfix">
        <table class="display" id="dataTable"> 
            <thead> 
                <tr> 
                    <th>STT</th> 
                    <th>Tiêu đề</th> 
                    <th>Ngày cập nhật</th> 
                    <th>Trạng thái</th> 
                    <th>Action</th> 
                </tr> 
            </thead>
            <tbody>
            <?php $index = 0; ?>
            <?php if(is_array($allPostInfo)) {?>
                <?php foreach($allPostInfo as $s): ?>
                    <?php $index++; ?>
                    <tr class="<?php echo ($s['status'] == 1) ? 'gradeA' : 'gradeX' ?>"> 
                        <td class="center"><?php echo $index ?></td> 
                        <td class="center"><?php echo $s['title'] ?></td> 
                        <td class="center"><?php echo $s['modified'] ?></td>
                        <td class="center">
                            <?php 
                                switch ($s['status']) {
                                    case 1 : 
                                        echo 'Hiển thị';
                                        break;
                                    case 0 :
                                        echo 'Ẩn';
                                        break;
                                }
                            ?>
                        </td>
                        <td class="center">
                            <a href="<?php echo site_url('admin/post/edit/' . $s['id']) ?>"><img src ="<?php echo STATIC_DOMAIN?>/images/simsodep/edit.png" alt="edit" title="Sửa"></a> 
                            -
                            <?php if($s['status'] == 1): ?>
                            <a id="icon_hide" href="<?php echo site_url('admin/post/hide/'. $s['id']) ?>"><img src ="<?php echo STATIC_DOMAIN?>/images/simsodep/hide.png" width="18" height="18" alt="hide" title="Ẩn"></a>
                            <?php else: ?>
                            <a id="icon_show" href="<?php echo site_url('admin/post/show/'. $s['id']) ?>"><img src ="<?php echo STATIC_DOMAIN?>/images/simsodep/show.png" width="18" height="18" alt="hide" title="Hiện"></a> 
                            <?php endif; ?>
                            - 
                            <a class="delete" href="<?php echo site_url('admin/post/delete/'. $s['id']) ?>"><img src ="<?php echo STATIC_DOMAIN?>/images/simsodep/delete.png" alt="delete" title="Xóa"></a>
                        </td>
                    </tr>
                <?php endforeach; ?>
            <?php }?>
            </tbody>
        </table>
        
        <!-- Begin pagination -->
        <div class="pagination" style="margin-top: 5px">
            <?php echo $pagination ?>
        </div>
        <!-- End pagination -->
    </div>
</div>